﻿using System;
using System.Collections.Generic;
using System.Text;
using Common;

namespace LoginServer
{
    public partial class ManagerUserConnection
    {
        public void SendMessageToUserID(int ID_User, MSG_GSM message, params object[] param)
        {
            User user = Users[ID_User] as User;
            user.SendMessage(message, param);
        }
        public void SendMessageToUserID(int ID_User, MSG_GSM message, byte[] param)
        {
            User user = Users[ID_User] as User;
            user.SendMessage(message, param);
        }
        public void SendMessageToAllUser(MSG_GSM message, params object[] param)
        {
            foreach (User user in Users.Values)
            {
                user.SendMessage(message, param);
            }
        }
        public void SendMessageToAllUser(MSG_GSM message, byte[] param)
        {
            foreach (User user in Users.Values)
            {
                user.SendMessage(message, param);
            }
        }
        public void SendMessageToAllExceptID(int ID_User, MSG_GSM message, params object[] param)
        {
            foreach (User user in Users.Values)
            {
                if (user.User_ID == ID_User)
                    continue;
                user.SendMessage(message, param);
            }
        }
        public void SendMessageToAllExceptID(int ID_User, MSG_GSM message, byte[] param)
        {
            foreach (User user in Users.Values)
            {
                if (user.User_ID == ID_User)
                    continue;
                user.SendMessage(message, param);
            }
        }
    }
}
